package Chapter2.Comparing;

public class ComparableRectangle extends Rectangle implements CompareObject {

    public ComparableRectangle() {
    }

    public ComparableRectangle(int base, int height) {
        super(base, height);
    }

    @Override
    public int compareTo(Object o) {
        Rectangle rectangle = (Rectangle) o;
        return this.rectanArea()-rectangle.rectanArea();
    }
}
